﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace WmsApp.WmsService
{
    public partial class OutStoreBillDtl : IWcfState
    {
        public static OutStoreBillDtl CreateOutStoreBillDtl(string billID)
        {
            var r = new OutStoreBillDtl
            {
                BillID = billID,
                BillDtlID = Guid.NewGuid().ToString(),
                SpecificationType = "",
                TaxRate = 0,
                AmountNotTax = 0,
                AmountTax = 0,
                PriceTax = 0,
                PriceNotTax = 0,
                Quantity = 1,
                WcfEntityState = System.Data.EntityState.Added
            };
            r.BindPropertyChanged();
            return r;
        }

        public void BindPropertyChanged()
        {
            this.PropertyChanged += WmsApp.EntityControl.PropertyChangedHandler.EntityObjectPropertyChanged;
        }

        public decimal  StoreGoodsQuantity
        {
            get { return Factory.WmsServiceFactory.GetServiceClient().GetStoreGoodsQuantity(this.NewGoodsCode); }
        }

    }
}
